package server;

import com.lagou.edu.pojo.Request;
import com.lagou.edu.pojo.Response;
import com.lagou.edu.servlet.HttpServlet;
import com.lagou.edu.util.HttpProtocolUtil;

/**
 * @ClassName: LagouServlet
 * @Auther: Jerry
 * @Date: 2020/7/31 23:11
 * @Desctiption: TODO
 * @Version: 1.0
 */
public class LagouServlet extends HttpServlet {

    @Override
    protected void doGet(Request request, Response response) throws Exception {
        String content = "<h1>demo1 LagouServlet doGet</h1>";
        response.output(HttpProtocolUtil.getHeader200(content.getBytes().length) + content);
    }

    @Override
    protected void doPost(Request request, Response response) throws Exception {
        String content = "<h1>demo1 LagouServlet doPost</h1>";
        response.output(HttpProtocolUtil.getHeader200(content.getBytes().length) + content);
    }
}
